package com.lei.util;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author lei Chu
 */
public class Constants {
    /**
     * 默认方法
     */
    public static final String INDEX = "index";

    /**
     * 转发开始标记
     */
    public static final String  FORWARD = "forward:";

    /**
     * 重定向路径
     */
    public static final String  REDIRECT = "redirect:";

    /**
     * 分割符
     */
    public static final String FLAG = ":";

    public static String getNow(){
        SimpleDateFormat formatter= new SimpleDateFormat("yyyy-MM-dd");
        Date date = new Date(System.currentTimeMillis());
        return formatter.format(date);
    }

    public static boolean isInt(Object obj){
        try {
            Integer.parseInt(obj+"");
            return true;
        } catch (NumberFormatException e) {
            return false;
        }
    }
}
